home *** CD-ROM | disk | FTP | other *** search
File List | 1989-04-11 | 2.8 KB | 128 lines |
- ' *******************************************
- ' * *
- ' * Animated Input GFA *
- ' * by A. Baggetta *
- ' * *
- ' * Copyright 1989 by ST-LOG *
- ' *******************************************
- '
- '
- ' Set screen colors
- '
- Setcolor 0,3,4,5
- Setcolor 15,7,7,7
- '
- ' Set the starting points for animated box
- '
- Cd_right%=5
- Rd_down%=5
- C%=10
- R%=10
- '
- ' Draw box of asterisks
- '
- Print At(Cd_right%,Rd_down%);"****************************"
- For Ln_row%=6 To 15
- Print At(Cd_right%,Ln_row%);"* *"
- Next Ln_row%
- Print At(Cd_right%,15);"***************************"
- Print At(11,7);"Enter Your Name:"
- '
- ' Begin the main loop for animation and input
- '
- Repeat
- X$=Inkey$
- '
- ' Move the asterisk to the right on screen
- '
- If X$="" And Rd_down%=5 And Cd_right%<32 Then
- Inc Cd_right%
- Print At(Cd_right%,Rd_down%);"*";
- @Del_ay
- Print At(Cd_right%,Rd_down%);" "
- @Del_ay
- Print At(Cd_right%,Rd_down%);"*"
- @Del_ay
- Endif
- '
- ' Move the asterisk down on screen
- '
- If X$="" And Cd_right%=32 And Rd_down%<15 Then
- Inc Rd_down%
- Print At(Cd_right%,Rd_down%);"*";
- @Del_ay
- Print At(Cd_right%,Rd_down%);" "
- @Del_ay
- Print At(Cd_right%,Rd_down%);"*"
- @Del_ay
- Endif
- '
- ' Move the asterisk to the left on screen
- '
- If X$="" And Rd_down%=15 And Cd_right%>5 Then
- Dec Cd_right%
- Print At(Cd_right%,Rd_down%);"*";
- @Del_ay
- Print At(Cd_right%,Rd_down%);" "
- @Del_ay
- Print At(Cd_right%,Rd_down%);"*"
- @Del_ay
- Endif
- '
- ' Move the asterisk up on screen
- '
- If X$="" And Cd_right%=5 And Rd_down%>5 Then
- Dec Rd_down%
- Print At(Cd_right%,Rd_down%);"*";
- @Del_ay
- Print At(Cd_right%,Rd_down%);" "
- @Del_ay
- Print At(Cd_right%,Rd_down%);"*"
- @Del_ay
- Endif
- '
- ' INPUT EXAMINATION
- '
- '
- ' If a legal key is pressed, print it.
- '
- If X$<>"" And X$<>Chr$(8) Then
- C%=C%+1
- Print At(C%,R%);X$
- Name$=Name$+X$
- Endif
- '
- ' If the <backspace> key is pressed, erase the string so far
- '
- If X$=Chr$(8) Then
- For Ers=10 To C%
- Print At(Ers,R%);" "
- Next Ers
- C%=10
- Name$=""
- Endif
- '
- ' If the <return> or the max length of string, jump out of loop
- '
- Until X$=Chr$(13) Or C%=25 ! Max happens to be 15 characters here.
- '
- ' Print the string -- here it is called Name$.
- '
- Print At(11,18);Name$
- Print At(13,20);"Press A Key"
- '
- ' Hold on screen for this demo until a key is pressed
- '
- Repeat
- Until Inkey$<>""
- Setcolor 0,7,7,7
- Setcolor 15,0,0,0
- '
- ' A delay loop to keep the asterisks from moving too fast.
- ' Make this a smaller number and watch the speed.
- '
- Procedure Del_ay
- For D%=1 To 100
- Next D%
- Return
-